/* user-passport/1.0.0 login.password.js md5:92333e364c93bcaf8f609a2bfd5061fb */
define("/includes/libraries/javascript/login/login.password.js", 
		["/includes/libraries/javascript/login/login.reg.js", 
		 "/includes/libraries/javascript/login/login.status.js", 
		 "/includes/libraries/javascript/login/tips.js",
		 "/includes/libraries/javascript/login/login.pubSub.js"],
function(require) {
    var c = require("/includes/libraries/javascript/login/login.reg.js");
    var d = require("/includes/libraries/javascript/login/login.status.js");
    //var e = require("/includes/libraries/javascript/login/js/login.safe.js");
    require("/includes/libraries/javascript/login/tips.js");
    var g = require("/includes/libraries/javascript/login/login.pubSub.js");
    var h = function(a) {
        a ? $(".capslock").show() : $(".capslock").hide()
    };
    var i = "";
    var j = function(a) {
        var b = a.keyCode || a.which;
        var c = a.shiftKey || 16 == b || !1;
        var d = b >= 65 && 90 >= b && !c;
        //var e = b >= 97 && 122 >= b && c;
        var f = b >= 65 && 90 >= b && c;
        var g = b >= 97 && 122 >= b && !c;
        return d ? (i = "on", h(!0)) : f || g ? (i = "off", h(!1)) : void 0
    };
    var k = function(a) {
        var b = a || window.event;
        20 == b.keyCode && "" != i && ("on" == i ? (i = "off", h(!1)) : (i = "on", h(!0)))
    };
    var l = {
        "password.focus": function() {
            g.subscribe("password.focus",
            function() {
                d.onEvent({
                    ele: n.ele.parent(),
                    addClass: "item-focus",
                    callback: function() {
                        var a = n.ele.val();
                        var b = n.safeEleCheck.prop("checked");
                        c.isEmpty(a) || b || n.ele.siblings(".clear-btn").show()
                    }
                })
            })
        },
        "password.blur": function() {
            g.subscribe("password.blur",
            function() {
                d.onEvent({
                    ele: n.ele.parent(),
                    removeClass: "item-focus",
                    callback: function() {
                        var a = n.ele.val();
                        c.isEmpty(a) && n.safeEle.next("txt").show()
                    }
                })
            })
        },
        "password.keyup": function() {
            g.subscribe("password.keyup",
            function(a) {
                k(a),
                d.onEvent({
                    callback: function() {
                        var a = n.ele.val();
                        c.isEmpty(a) ? n.ele.siblings(".clear-btn").hide() : n.ele.siblings(".clear-btn").show()
                    }
                })
            })
        },
        "password.keypress": function() {
            g.subscribe("password.keypress",
            function(a) {
                j(a)
            })
        },
        "password.Tips": function() {
            $("#jdsafe").tips({
                width: 138,
                type: "hover",
                hasArrow: !1,
                hasClose: !1,
                autoResize: !1,
                diff: 0,
                tipsClass: "safetips",
                mouseleaveDelayTime: 100
            })
        },
        "password.clear": function() {
            g.subscribe("password.clear",
            function() {
                h(!1)
            })
        },
        "password.autologinInfo": function() {
            g.subscribe("password.autologinInfo",
            function(a) {
                var b = a.prop("checked");
                //e.createAutoLoginInfo(b)
            })
        },
        "password.safeOcx.use": function() {
            g.subscribe("password.safeOcx.use",
            function(a) {
                var b = a.prop("checked");
                var d = "undefined" != typeof pgeditor;
                var f = d && pgeditor.checkInstall();
                if (b ? ($("#entry").removeClass("item-error item-focus"), $(".capslock").hide()) : n.safeEle.hide(), f || b && e.createInfo(), f && b && (n.safeEle.show(), n.safeEle.next("txt").hide(), n.ele.hide().val("")), f && !b) {
                    try {
                        d && pgeditor.pwdclear()
                    } catch(g) {}
                    n.safeEle.hide(),
                    n.safeEle.next("txt").show(),
                    n.ele.show();
                    var h = n.ele.val();
                    c.isEmpty(h) ? n.ele.siblings(".clear-btn").hide() : n.ele.siblings(".clear-btn").show()
                }
            })
        },
        "passwordField.focus": function() {
            g.subscribe("passwordField.focus",
            function() {
                n.ele.trigger("focus"),
                n.ocxEle.trigger("focus")
            })
        }
    };
    for (var m in l) l.hasOwnProperty(m) && l[m]();
    var n = {
        ele: $("#nloginpwd"),
        safeEle: $("#sloginpwd"),
        ocxEle: $("#_ocx_password"),
        safeEleCheck: $("#chkOpenCtrl"),
        autoLoginEle: $("#autoLogin"),
        otherUser: $(".more-slide"),
        init: function() {
            this.ele.bind("focus",
            function() {
                g.publish("password.focus")
            }),
            this.ocxEle.live("focus",
            function() {
                g.publish("password.focus")
            }),
            this.ele.bind("blur",
            function() {
                g.publish("password.blur")
            }),
            this.ocxEle.live("blur",
            function() {
                g.publish("password.blur")
            }),
            this.ele.bind("keyup",
            function(a) {
                g.publish("password.keyup", a)
            }),
            this.ele.bind("keypress",
            function(a) {
                g.publish("password.keypress", a)
            }),
            this.safeEleCheck.bind("click",
            function() {
                g.publish("password.safeOcx.use", $(this))
            }),
            this.autoLoginEle.bind("click",
            function() {
                g.publish("password.autologinInfo", $(this))
            }),
            this.otherUser.hover(function() {
                var a = $(this).attr("timer");
                var b = $(this);
                clearTimeout(a),
                $(this).attr("timer", setTimeout(function() {
                    b.addClass("more-hover")
                },
                500))
            },
            function() {
                var a = $(this).attr("timer");
                clearTimeout(a),
                $(this).removeClass("more-hover")
            }),
            g.publish("password.clear"),
            g.publish("password.Tips")
        }
    };
    return n
});